Optimal. Leaf size=157 \[ -\frac{c^4 (-5 B+i A) \tan ^2(e+f x)}{2 a f}+\frac{c^4 (5 A+12 i B) \tan (e+f x)}{a f}-\frac{8 c^4 (A+i B)}{a f (-\tan (e+f x)+i)}-\frac{4 c^4 (-5 B+3 i A) \log (\cos (e+f x))}{a f}-\frac{4 c^4 x (3 A+5 i B)}{a}-\frac{i B c^4 \tan ^3(e+f x)}{3 a f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.215932, antiderivative size = 157, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.049, Rules used = {3588, 77} \[ -\frac{c^4 (-5 B+i A) \tan ^2(e+f x)}{2 a f}+\frac{c^4 (5 A+12 i B) \tan (e+f x)}{a f}-\frac{8 c^4 (A+i B)}{a f (-\tan (e+f x)+i)}-\frac{4 c^4 (-5 B+3 i A) \log (\cos (e+f x))}{a f}-\frac{4 c^4 x (3 A+5 i B)}{a}-\frac{i B c^4 \tan ^3(e+f x)}{3 a f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3588
Rule 77
Rubi steps
\begin{align*} \int \frac{(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{a+i a \tan (e+f x)} \, dx &=\frac{(a c) \operatorname{Subst}\left (\int \frac{(A+B x) (c-i c x)^3}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a c) \operatorname{Subst}\left (\int \left (\frac{(5 A+12 i B) c^3}{a^2}+\frac{(-i A+5 B) c^3 x}{a^2}-\frac{i B c^3 x^2}{a^2}-\frac{8 (A+i B) c^3}{a^2 (-i+x)^2}+\frac{4 i (3 A+5 i B) c^3}{a^2 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{4 (3 A+5 i B) c^4 x}{a}-\frac{4 (3 i A-5 B) c^4 \log (\cos (e+f x))}{a f}-\frac{8 (A+i B) c^4}{a f (i-\tan (e+f x))}+\frac{(5 A+12 i B) c^4 \tan (e+f x)}{a f}-\frac{(i A-5 B) c^4 \tan ^2(e+f x)}{2 a f}-\frac{i B c^4 \tan ^3(e+f x)}{3 a f}\\ \end{align*}
Mathematica [A] time = 3.76031, size = 260, normalized size = 1.66 \[ \frac{c^4 (\cos (f x)+i \sin (f x)) (A+B \tan (e+f x)) \left (24 (A+i B) (\sin (e)+i \cos (e)) \cos (2 f x)+24 (A+i B) (\cos (e)-i \sin (e)) \sin (2 f x)+12 (5 B-3 i A) \left (\cos \left (\frac{e}{2}\right )+i \sin \left (\frac{e}{2}\right )\right )^2 \log \left (\cos ^2(e+f x)\right )-24 (3 A+5 i B) (\cos (e)+i \sin (e)) \tan ^{-1}(\tan (f x))+\cos (e) (\tan (e)-i) (2 B \tan (e)+3 (A+5 i B)) \sec ^2(e+f x)+2 (15 A+37 i B) (1+i \tan (e)) \sin (f x) \sec (e+f x)+2 B (\tan (e)-i) \sin (f x) \sec ^3(e+f x)\right )}{6 f (a+i a \tan (e+f x)) (A \cos (e+f x)+B \sin (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.046, size = 193, normalized size = 1.2 \begin{align*}{\frac{5\,B{c}^{4} \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2\,af}}-{\frac{{\frac{i}{3}}B{c}^{4} \left ( \tan \left ( fx+e \right ) \right ) ^{3}}{af}}+5\,{\frac{A{c}^{4}\tan \left ( fx+e \right ) }{af}}-{\frac{{\frac{i}{2}}{c}^{4}A \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{af}}+{\frac{12\,i{c}^{4}B\tan \left ( fx+e \right ) }{af}}+{\frac{8\,iB{c}^{4}}{af \left ( \tan \left ( fx+e \right ) -i \right ) }}+8\,{\frac{A{c}^{4}}{af \left ( \tan \left ( fx+e \right ) -i \right ) }}+{\frac{12\,i{c}^{4}A\ln \left ( \tan \left ( fx+e \right ) -i \right ) }{af}}-20\,{\frac{B{c}^{4}\ln \left ( \tan \left ( fx+e \right ) -i \right ) }{af}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.44351, size = 817, normalized size = 5.2 \begin{align*} -\frac{24 \,{\left (3 \, A + 5 i \, B\right )} c^{4} f x e^{\left (8 i \, f x + 8 i \, e\right )} -{\left (12 i \, A - 12 \, B\right )} c^{4} +{\left (72 \,{\left (3 \, A + 5 i \, B\right )} c^{4} f x -{\left (36 i \, A - 60 \, B\right )} c^{4}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} +{\left (72 \,{\left (3 \, A + 5 i \, B\right )} c^{4} f x -{\left (90 i \, A - 150 \, B\right )} c^{4}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (24 \,{\left (3 \, A + 5 i \, B\right )} c^{4} f x -{\left (66 i \, A - 110 \, B\right )} c^{4}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} -{\left ({\left (-36 i \, A + 60 \, B\right )} c^{4} e^{\left (8 i \, f x + 8 i \, e\right )} +{\left (-108 i \, A + 180 \, B\right )} c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} +{\left (-108 i \, A + 180 \, B\right )} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (-36 i \, A + 60 \, B\right )} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{3 \,{\left (a f e^{\left (8 i \, f x + 8 i \, e\right )} + 3 \, a f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 11.4177, size = 301, normalized size = 1.92 \begin{align*} \frac{\frac{\left (8 i A c^{4} - 16 B c^{4}\right ) e^{- 2 i e} e^{4 i f x}}{a f} + \frac{\left (18 i A c^{4} - 38 B c^{4}\right ) e^{- 4 i e} e^{2 i f x}}{a f} + \frac{\left (30 i A c^{4} - 74 B c^{4}\right ) e^{- 6 i e}}{3 a f}}{e^{6 i f x} + 3 e^{- 2 i e} e^{4 i f x} + 3 e^{- 4 i e} e^{2 i f x} + e^{- 6 i e}} + \frac{c^{4} \left (- 12 i A + 20 B\right ) \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} - \frac{\left (\begin{cases} 24 A c^{4} x e^{2 i e} - \frac{4 i A c^{4} e^{- 2 i f x}}{f} + 40 i B c^{4} x e^{2 i e} + \frac{4 B c^{4} e^{- 2 i f x}}{f} & \text{for}\: f \neq 0 \\x \left (24 A c^{4} e^{2 i e} - 8 A c^{4} + 40 i B c^{4} e^{2 i e} - 8 i B c^{4}\right ) & \text{otherwise} \end{cases}\right ) e^{- 2 i e}}{a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.53566, size = 602, normalized size = 3.83 \begin{align*} -\frac{2 \,{\left (\frac{12 \,{\left (-3 i \, A c^{4} + 5 \, B c^{4}\right )} \log \left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - i\right )}{a} - \frac{6 \,{\left (-3 i \, A c^{4} + 5 \, B c^{4}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{a} + \frac{6 \,{\left (3 i \, A c^{4} - 5 \, B c^{4}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{a} - \frac{3 \,{\left (-18 i \, A c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 30 \, B c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 44 \, A c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 68 i \, B c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 18 i \, A c^{4} - 30 \, B c^{4}\right )}}{a{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - i\right )}^{2}} + \frac{-33 i \, A c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{6} + 55 \, B c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{6} + 15 \, A c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 36 i \, B c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 102 i \, A c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} - 180 \, B c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} - 30 \, A c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 76 i \, B c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 102 i \, A c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 180 \, B c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 15 \, A c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 36 i \, B c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 33 i \, A c^{4} - 55 \, B c^{4}}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 1\right )}^{3} a}\right )}}{3 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]